
import Vue from 'vue'
import Router from 'vue-router'

const topNav = r => require.ensure([], () => r(require('@/components/nav/topNav')), 'topNav')//公共组件头
const wechatLogin = r => require.ensure([], () => r(require('@/pages/login/wechatLogin')), 'wechatLogin')//微信免登陆
const login = r => require.ensure([], () => r(require('@/pages/login/login')), 'login')//常规登陆

//学生路由
const studentApp = r => require.ensure([], () => r(require('@/pages/student/studentApp/studentApp')), 'studentIndex')//学生父级页面
const studentIndex = r => require.ensure([], () => r(require('@/pages/student/studentIndex/studentIndex')), 'studentIndex')//学生首页
const studentUserInfo = r => require.ensure([], () => r(require('@/pages/student/studentUserInfo/studentUserInfo')), 'studentUserInfo')//学生个人信息中心
const studentPersonalInfo = r => require.ensure([], () => r(require('@/pages/student/studentUserInfo/personal_info')), 'PersonalInfo')//学生个人明细
const studentprobFeedback = r => require.ensure([], () => r(require('@/pages/student/studentUserInfo/problem_feedback')), 'probFeedback')//学生反馈问题
const studentChangePassword = r => require.ensure([], () => r(require('@/pages/student/studentUserInfo/change_passwordUpd')), 'studentChangePassword')//学生修改密码
const studentCommissary = r => require.ensure([], () => r(require('@/pages/student/studentCommissary/commissary')), 'studentCommissary')//学生修改密码
const studentSchedule = r => require.ensure([], () => r(require('@/pages/student/schedule/schedule')), 'studentSchedule')//学生修改密码



//const wechatregister = r => require.ensure([], () => r(require('@/page/wechatregister')), 'wechatregister')


Vue.use(Router)

var routes= [
	{
      path: '/wechatLogin',
      name: 'wechatLogin',
      component: wechatLogin
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/studentApp',
      name: 'studentApp',
      meta: {
            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
        },
      component: studentApp,
      children:[
      		{
		      path: '/studentIndex',
		      name: 'studentIndex',
		      meta: {
		            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
		        },
		      component: studentIndex
		    },
		    {
		      path: '/studentUserInfo',
		      name: 'studentUserInfo',
		      meta: {
		            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
		        },
		      component: studentUserInfo
		    },
	
      ]
    },
    	    {
        path: '/studentPersonalInfo',
        name: 'studentPersonalInfo',
        meta: {
          requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
        },
        component: studentPersonalInfo
      	},
      	      {
        path: '/studentprobFeedback',
        name: 'studentprobFeedback',
        meta: {
          requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
        },
        component: studentprobFeedback
      },
       {
        path: '/studentChangePassword',
        name: 'studentChangePassword',
        meta: {
          requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
        },
        component: studentChangePassword
      },
        {
        path: '/studentCommissary',
        name: 'studentCommissary',
        meta: {
          requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
        },
        component: studentCommissary
      },
      {
        path: '/studentSchedule',
        name: 'studentSchedule',
        meta: {
          requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
        },
        component: studentSchedule
      },
    {
      path: '/topNav',
      name: 'topNav',
      meta: {
            requireAuth: false,  // 添加该字段，表示进入这个路由是需要登录的
        },
      component: topNav
    },
//   {
//    path: '/wechatregister',
//    name: 'wechatregister',
//    component: wechatregister
//  }
  ];



export default new Router({
  routes:routes
})


